1. Field of the Invention
This invention relates generally to a final form document and to automatic recognition of the type of encoding used to encode the final form document into a standard page description language. In this context, a final form document is not only envisaged as commands to a computer printer but also as commands to a remote fax printer or other types of display or presentation devices. This invention particularly relates to a method and system to efficiently and automatically determine whether a document has been encoded in the Standard Page Description Language and if encoded in the Standard Page Description Language, whether it has been encoded in a binary format or in a clear text format.
2. Discussion of the Background
PostScript.RTM. by Adobe Systems, Inc. is a page description language ("PDL") which was originally only a clear text encoding language. A clear text encoding language is a type of computer language which is human readable. An example of a non-clear text encoding language would be a binary encoding of a document as a human could not readily understand the contents of the document by looking at the binary or hexadecimal representation of the document. In the PostScript Level 2 system and the display PostScript systems, Adobe added the binary token and binary object encodings.
To determine if a file is a clear text or binary encoded PostScript file, the first character in the file is examined and if it is found to be in the range of 128 to 159 it is considered a binary PostScript file. In the recommended syntax of PostScript, for clear text, the first line in the program is recommended to begin with "%!PS-Adobe-3.0". It is believed that this comment line at the beginning of a file should have no spaces before the comment and no spaces interposed during the comment. This comment signals a document manager that the file contains a program which conforms to version 3.0 of the Document Structure Convention of PostScript and is in fact a PostScript file. To determine if a document is a PostScript file, one only has to examine if the pattern "%!PS-Adobe-3.0" is at the very beginning of the file. However, the language itself is not self-identifying to be PostScript. Therefore, the omission of this first line does not cause the PostScript Interpreter to reject the input.
The Standard Page Description Language is a proposed PDL in the process of being developed as an international standard by several people including the inventors herein. The proposal is currently in draft form before a section of the International Standards Organization ("ISO") as ISO/IEC DIS 10180 and is available through the American National Standards Institute ("ANSI") in New York. Both binary and clear text SPDL documents contain a header which identifies that the input is SPDL.